package avicit.cbb.techclass.billdefine.action.service.impl;

import avicit.cbb.billdefine.service.BillDefineDynamicService;
import avicit.cbb.tabledefine.service.CommTableManagerIntfsService;
import avicit.cbb.techclass.billdefine.action.service.BillDefineDynamicService;
import avicit.cbb.techclass.tabledefine.commtablemanager.action.CommTableSysFieldLoader;
import avicit.platform6.core.properties.PlatformConstant.OpResult;
import avicit.platform6.core.properties.PlatformConstant.OpType;
import avicit.platform6.modules.system.syslog.service.LogBaseFactory;
import avicit.platform6.modules.system.syslog.service.SysLogUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * <p>
 * 金航数码科技有限责任公司
 * </p>
 * <p>
 * 作者：钟一华
 * </p>
 * <p>
 * 邮箱：zhongyih@avicit.com
 * </p>
 * <p>
 * 创建时间： 2016-04-12 上午11:52:26
 * </p>
 * <p>
 * 类说明：动态字段添加,编辑,详细,查询数据获取实现类
 * </p>
 * <p>
 * 修改记录：
 * </p>
 */
@Service
@SuppressWarnings("unchecked")
public class BillDefineDynamicServiceImpl implements BillDefineDynamicService {

    @Autowired(required = true)
    private CommTableSysFieldLoader commTableSysFieldLoader;
    @Autowired(required = true)
    CommTableManagerIntfsService commTableManagerIntfsService;

    /**
     * 获取动态ADD页面HTML
     *
     * @param formShowList 动态字段数据集合
     * @param mapCode      通用代码字符串
     * @param param        {
     *                     MODEL_CODE: 模块CODE,
     *                     FORM_CODE: 表单CODE,
     *                     MODEL_COLUMN: 模板显示列数,
     *                     COL_SPAN: 对应字段跨列数组,
     *                     ROW_SPAN: 对应字段跨行数组
     *                     }
     * @return
     * @throws Exception
     */
    @Override
    public String getDynamicAddHtml(List<Map<String, Object>> formShowList, Map<String, Map<String, String>> mapCode, Map<String, Object> param) throws Exception {
        // 定义模板列数样式
        Map<String, String> columnStyle = new HashMap<String, String>();
        // 模板列数
        int modelColumn = 3;
        // 跨列数组
        int[] colSpanIndex = null;
        // 跨行数组
        int[] rowSpanIndex = null;
        // 模块Code
        String modelCode = "";
        // 表单Code
        String formCode = "";
        if (null != param) {
            modelCode = (String) param.get("MODEL_CODE");
            formCode = (String) param.get("FORM_CODE");
            modelColumn = Integer.parseInt(param.get("MODEL_COLUMN") + "");
            // colspan list转数组
            List<Integer> colSpanList = (List<Integer>) param.get("COL_SPAN");
            if (colSpanList.size() > 0 && colSpanList.size() == formShowList.size()) {
                colSpanIndex = new int[colSpanList.size()];
                for (int i = 0; i < colSpanList.size(); i++) {
                    colSpanIndex[i] = colSpanList.get(i);
                }
            } else {
                colSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < colSpanIndex.length; i++) {
                    colSpanIndex[i] = 1;
                }
            }
            // rowspan list转数组
            List<Integer> rowSpanList = (List<Integer>) param.get("ROW_SPAN");
            if (rowSpanList.size() > 0 && rowSpanList.size() == formShowList.size()) {
                rowSpanIndex = new int[rowSpanList.size()];
                for (int i = 0; i < rowSpanList.size(); i++) {
                    rowSpanIndex[i] = rowSpanList.get(i);
                }
            } else {
                rowSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < rowSpanIndex.length; i++) {
                    rowSpanIndex[i] = 1;
                }
            }
            if (colSpanList.size() != formShowList.size() || rowSpanList.size() != formShowList.size()) {
                SysLogUtil.log("构建动态添加页面方法", "构建动态添加页面方法出错，表单列值和实际列值不符！", OpType.select, OpResult.failure, LogBaseFactory.getLogBase());
            }
        }
        // 选择列宽样式
        switch (modelColumn) {
            case 1:
                columnStyle.put("thWidth", "35%");
                columnStyle.put("tdWidth", "65%");
                break;
            case 2:
                columnStyle.put("thWidth", "15%");
                columnStyle.put("tdWidth", "35%");
                break;
            case 3:
                columnStyle.put("thWidth", "10%");
                columnStyle.put("tdWidth", "23%");
                break;
            case 4:
                columnStyle.put("thWidth", "8%");
                columnStyle.put("tdWidth", "17%");
                break;
            default:
                columnStyle.put("thWidth", "20%");
                columnStyle.put("tdWidth", "80%");
                break;
        }
        // 计算数
        int sum = 0;
        // 添加tr下标
        List<Integer> addTr = new ArrayList<Integer>();
        // 补位td下标
        List<Integer> addTd = new ArrayList<Integer>();
        for (int i = 0; i < colSpanIndex.length; i++) {
            sum += colSpanIndex[i];
            // 如果计算数等于模板列数,则需进行换行,记录下标
            if (sum == modelColumn) {
                // 记录换行下标
                addTr.add(i);
                // 记录补位数
                addTd.add(0);
                // 清空计算数
                sum = 0;
            }
            // 判断索引是否可以循环下一次
            if (i < colSpanIndex.length - 1) {
                // 计算数累加下一下标跨列数
                int nextSum = sum + colSpanIndex[i + 1];
                // 如果累加下一跨列数大于模板列数,则记录换行下标,并记录补位数
                if (nextSum > modelColumn) {
                    // 记录换行下标
                    addTr.add(i);
                    // 记录补位数
                    addTd.add(modelColumn - sum);
                    // 清空计算数
                    sum = 0;
                }
            }
        }
        StringBuffer sb = new StringBuffer();
        sb.append("<tr>");
        for (int i = 0; i < modelColumn; i++) {
            sb.append("<th width='" + columnStyle.get("thWidth") + "'></th><td width='" + columnStyle.get("tdWidth") + "'></td>");
        }
        sb.append("</tr>");
        sb.append("<tr>");
        String requiredCode = ",validType:'comboRequired'";
        if (null != formShowList) {
            // 获取设置组合项字段
            List<Map<String, Object>> columnList = new ArrayList<Map<String, Object>>();
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                String colGeneMethod = (String) cc.get("COL_GENE_METHOD");
                String groupConfigStr = (String) cc.get("GROUP_CONFIG");
                String colDropdownType = (String) cc.get("COL_DROPDOWN_TYPE");
                // 如果生成方式是组合项
                if (null != colGeneMethod && "4".equals(colGeneMethod)) {
                    List<Map<String, Object>> groupList = commTableManagerIntfsService.getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs((String) cc.get("ID"));
                    // 将组合项字段的config字符串追加到每个设置字段中
                    for (int j = 0; j < groupList.size(); j++) {
                        Map<String, Object> groupMap = groupList.get(j);
                        groupMap.put("GROUP_CONFIG_STR", groupConfigStr);
                        groupMap.put("COL_DROPDOWN_TYPE", colDropdownType);
                        groupMap.put("COL_TYPE", cc.get("COL_TYPE"));
                        columnList.add(groupMap);
                    }
                }
            }
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                // 判断当前字段是否被设置组合项
                boolean isSet = false;
                List<Map<String, Object>> groupColList = new ArrayList<Map<String, Object>>();
                for (int j = 0; j < columnList.size(); j++) {
                    Map<String, Object> groupCol = columnList.get(j);
                    if (cc.get("ID").equals(groupCol.get("TARGET_COLUMN_ID"))) {
                        isSet = true;
                        groupColList.add(groupCol);
                    }
                }
                String isMast = "";
                String labelbg = "";
                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                    isMast = "true";
                    labelbg = "remind";
                } else {
                    isMast = "false";
                }
                String length = "";
                if (cc.get("COL_LENGTH") != null) {
                    length = ",validType:'length[0," + cc.get("COL_LENGTH") + "]'";
                }
                // 参选
                if ("1".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                    String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                    if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                        sb.append("<sec:accesscontrollist  hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                        sb.append("<th><span class=\"" + labelbg + "\">");
                                        String requiredString = "";
                                        if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                            sb.append("*");
                                            requiredString = requiredCode;
                                        }
                                        sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                        sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                        sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\"");
                                        sb.append("data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + length + ",onLoadSuccess:function(){$('#" + cc.get("COL_NAME")
                                                + "').next('.combo').find('input').focus(function(){groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');});}\"");
                                        sb.append("class=\"easyui-combobox\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >");
                                        Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                        while (iteratorCode.hasNext()) {
                                            String lookupCode = String.valueOf(iteratorCode.next());
                                            String lookupName = codeValue.get(lookupCode);
                                            if (cc.get("COL_VALUE").equals(lookupCode)) {
                                                sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                            } else {
                                                sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                            }
                                        }
                                        sb.append("</select>");
                                        sb.append("</td>");
                                        sb.append("</sec:accesscontrollist>");
                                    } else {
                                        sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                        sb.append("<th><span class=\"" + labelbg + "\">");
                                        String requiredString = "";
                                        if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                            sb.append("*");
                                            requiredString = requiredCode;
                                        }
                                        sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                        sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                        sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + length + "\"");
                                        sb.append("class=\"easyui-combobox\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >");
                                        Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                        while (iteratorCode.hasNext()) {
                                            String lookupCode = String.valueOf(iteratorCode.next());
                                            String lookupName = codeValue.get(lookupCode);
                                            if (cc.get("COL_VALUE").equals(lookupCode)) {
                                                sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                            } else {
                                                sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                            }
                                        }
                                        sb.append("</select>");
                                        sb.append("</td>");
                                        sb.append("</sec:accesscontrollist>");
                                    }
                                } else {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + length + "\"");
                                    sb.append("class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\">");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                }
                            }
                        }
                    }
                } else if ("2".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"false\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + "\""); // +
                                    // length
                                    sb.append("class=\"easyui-combobox\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    sb.append(" </select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                } else {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"false\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + "\""); // +
                                    // length
                                    sb.append("	class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" readonly=\"readonly\">");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                }
                            }
                        }
                    }
                    // 如果为选择
                } else if ("3".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    if ("user".equals(cc.get("COL_RULE_NAME"))) {
                        // String ww = (String) cc.get("COL_NAME");
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：user，那么该字段为选人页
                            // 字段可编辑，根据ID创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                // sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\""
                                // + cc.get("COL_NAME") + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + ((null ==
                                // cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                // sb.append("	value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" +
                                // "\" name=\"" + cc.get("COL_NAME") + "NAME" + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  type=\"hidden\"  value=\"" + ((null ==
                                // cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"/>");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                sb.append("	value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input id=\"" + cc.get("COL_NAME") + "_ID" + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\"  type=\"hidden\"  value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"/>");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        } else {
                            // 如果为生成规则英文字段为：user，那么该字段为选人页
                            // 字段不可编辑，在原ID基础上加1，不能创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                // sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\""
                                // + cc.get("COL_NAME") + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + ((null ==
                                // cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "1\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                // sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" +
                                // "1\" name=\"" + cc.get("COL_NAME") + "NAME" + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  type=\"hidden\" value=\"" + ((null ==
                                // cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"/>");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input id=\"" + cc.get("COL_NAME") + "NAME" + "1\" name=\"" + cc.get("COL_NAME") + "NAME" + "1\"  type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"/>");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        }
                    } else if ("dept".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                            // 字段可编辑，根据ID创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                // sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\""
                                // + cc.get("COL_NAME") + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\"  value=\"" + ((null ==
                                // cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\"  value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                // sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" +
                                // "\" name=\"" + cc.get("COL_NAME") + "NAME" + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE")
                                // || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\"");
                                sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input id=\"" + cc.get("COL_NAME") + "_ID" + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        } else {
                            // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                            // 字段不可编辑，在原ID基础上加1，不能创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                // sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\""
                                // + cc.get("COL_NAME") + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + ((null ==
                                // cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "1\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                // sb.append("	value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" +
                                // "1\" name=\"" + cc.get("COL_NAME") + "NAME" + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE")
                                // || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                                sb.append("	value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input id=\"" + cc.get("COL_NAME") + "NAME" + "1\" name=\"" + cc.get("COL_NAME") + "NAME" + "1\" type=\"hidden\" value=\"" + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        }
                    } else if ("custom".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                            // 字段可编辑，根据图片点击事件创建弹出页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("*");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<div style=\"position: relative; \">");
                            sb.append("<input title=\"_" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" value=\""
                                    + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\">");
                            sb.append("<input title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" type=\"text\" id=\"" + cc.get("COL_NAME") + "NAME" + "\" onclick=\"getKmNoumenon('" + cc.get("CUSTOM_PATH") + "','" + cc.get("COL_RULE_TITLE") + "','"
                                    + cc.get("COL_NAME") + "');\" style=\"cursor: pointer\" data-options=\"required:" + isMast + length + "\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" readonly=\"readonly\">");
                            sb.append("<img src=\"avicit/platform6/component/css/commonselection/icons_ext/selectorCommon.gif\" style=\"display: block;z-index: 800; position: absolute; float: right; top: 3px; cursor: pointer; right: -3px;\" onclick=\"getKmNoumenon('"
                                    + cc.get("CUSTOM_PATH") + "','" + cc.get("COL_RULE_TITLE") + "','" + cc.get("COL_NAME") + "');\"/>");
                            sb.append("</div>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                            // 字段不可编辑，去掉图片点击事件就不能创建弹出页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("*");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<div style=\"position: relative; \">");
                            sb.append("<input title=\"_" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" value=\""
                                    + ((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\">");
                            sb.append("<input title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" type=\"text\" id=\"" + cc.get("COL_NAME") + "NAME" + "\"  style=\"cursor: pointer\" data-options=\"required:" + isMast + length + "\" value=\""
                                    + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" readonly=\"readonly\">");
                            sb.append("<img src=\"avicit/platform6/component/css/commonselection/icons_ext/selectorCommon.gif\" style=\"display: block;z-index: 800; position: absolute; float: right; top: 3px; cursor: pointer; right: -3px;\" />");
                            sb.append("</div>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    }
                } else {
                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                    sb.append("<th>");
                    sb.append("<span class=\"" + labelbg + "\">");
                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                        sb.append("*");
                    }
                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                    if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                        sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    } else {
                        sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    }
                    if ("integer".equals(cc.get("COL_TYPE"))) {
                        if (isSet) {
                            // 设置组合项的字段名，多个以；隔开
                            String sourceColName = "";
                            // 设置组合项的配置字符串，多个以|隔开
                            String sourceConfigStr = "";
                            // 设置组合项的字段类型
                            String sourceColType = "";
                            // 设置组合项的字段下拉类型
                            String sourceColDropdownType = "";
                            for (int j = 0; j < groupColList.size(); j++) {
                                Map<String, Object> groupColMap = groupColList.get(j);
                                if ("".equals(sourceColName)) {
                                    sourceColName = (String) groupColMap.get("COL_NAME");
                                    sourceColType = (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType = (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                } else {
                                    sourceColName += ";" + (String) groupColMap.get("COL_NAME");
                                    sourceColType += ";" + (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType += ";" + (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                }
                                if ("".equals(sourceConfigStr)) {
                                    sourceConfigStr = (String) groupColMap.get("GROUP_CONFIG_STR");
                                } else {
                                    sourceConfigStr += "|" + (String) groupColMap.get("GROUP_CONFIG_STR");
                                }
                            }
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append(" onkeyup=\"changeGroup('" + sourceColName + "','" + sourceColType + "','" + sourceColDropdownType + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "', '" + sourceConfigStr + "');\"");
                                    sb.append(" />");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        }
                    } else if ("float".equals(cc.get("COL_TYPE"))) {
                        if (isSet) {
                            // 设置组合项的字段名，多个以；隔开
                            String sourceColName = "";
                            // 设置组合项的配置字符串，多个以|隔开
                            String sourceConfigStr = "";
                            // 设置组合项的字段类型
                            String sourceColType = "";
                            // 设置组合项的字段下拉类型
                            String sourceColDropdownType = "";
                            for (int j = 0; j < groupColList.size(); j++) {
                                Map<String, Object> groupColMap = groupColList.get(j);
                                if ("".equals(sourceColName)) {
                                    sourceColName = (String) groupColMap.get("COL_NAME");
                                    sourceColType = (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType = (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                } else {
                                    sourceColName += ";" + (String) groupColMap.get("COL_NAME");
                                    sourceColType += ";" + (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType += ";" + (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                }
                                if ("".equals(sourceConfigStr)) {
                                    sourceConfigStr = (String) groupColMap.get("GROUP_CONFIG_STR");
                                } else {
                                    sourceConfigStr += "|" + (String) groupColMap.get("GROUP_CONFIG_STR");
                                }
                            }
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append(" onkeyup=\"changeGroup('" + sourceColName + "','" + sourceColType + "','" + sourceColDropdownType + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "', '" + sourceConfigStr + "');\"");
                                    sb.append(" />");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE"))
                                        + "\"></input>");
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE"))
                                        + "\"></input>");
                            }
                        }
                    } else if ("date".equals(cc.get("COL_TYPE"))) {
                        if (isSet) {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                sb.append("<input class=\"easyui-datebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md', required:" + isMast + ",");
                                sb.append(" onSelect: changeGroupValueByDate\"");
                                sb.append(" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            } else {
                                sb.append("<input class=\"easyui-datebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md'\" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                sb.append("<input class=\"easyui-datebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md', required:" + isMast + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            } else {
                                sb.append("<input class=\"easyui-datebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md'\" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        }
                    } else if ("string".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        if (isSet) {
                            // 设置组合项的字段名，多个以；隔开
                            String sourceColName = "";
                            // 设置组合项的配置字符串，多个以|隔开
                            String sourceConfigStr = "";
                            // 设置组合项的字段类型
                            String sourceColType = "";
                            // 设置组合项的字段下拉类型
                            String sourceColDropdownType = "";
                            for (int j = 0; j < groupColList.size(); j++) {
                                Map<String, Object> groupColMap = groupColList.get(j);
                                if ("".equals(sourceColName)) {
                                    sourceColName = (String) groupColMap.get("COL_NAME");
                                    sourceColType = (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType = (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                } else {
                                    sourceColName += ";" + (String) groupColMap.get("COL_NAME");
                                    sourceColType += ";" + (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType += ";" + (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                }
                                if ("".equals(sourceConfigStr)) {
                                    sourceConfigStr = (String) groupColMap.get("GROUP_CONFIG_STR");
                                } else {
                                    sourceConfigStr += "|" + (String) groupColMap.get("GROUP_CONFIG_STR");
                                }
                            }
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                if (rowSpanIndex[i] > 1) {
                                    sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append(" data-options=\"required:" + isMast + length + "\" >" + replaceValue + "</textarea>");
                                } else {
                                    sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                    sb.append(" onkeyup=\"changeGroup('" + sourceColName + "','" + sourceColType + "','" + sourceColDropdownType + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "', '" + sourceConfigStr + "');\"");
                                    sb.append("></input>");
                                }
                            } else {
                                if (rowSpanIndex[i] > 1) {
                                    sb.append("<textarea class=\"textareabox input-readonly\" rows=\"" + rowSpanIndex[i] + "\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" readonly=\"readonly\" >" + replaceValue + "</textarea>");
                                } else {
                                    sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" readonly=\"readonly\" value=\"" + replaceValue + "\"></input>");
                                }
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    if (rowSpanIndex[i] > 1) {
                                        sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                                + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" ");
                                        sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\">" + replaceValue + "</textarea>");
                                    } else {
                                        sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                        sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                    }
                                } else {
                                    if (rowSpanIndex[i] > 1) {
                                        sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                                + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" >" + replaceValue + "</textarea>");
                                    } else {
                                        sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"></input>");
                                    }
                                }
                            } else {
                                if (rowSpanIndex[i] > 1) {
                                    sb.append("<textarea class=\"textareabox input-readonly\" rows=\"" + rowSpanIndex[i] + "\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" readonly=\"readonly\" >" + replaceValue + "</textarea>");
                                } else {
                                    sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" readonly=\"readonly\" value=\"" + replaceValue + "\"></input>");
                                }
                            }
                        }
                    } else if ("clob".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                            if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                            } else {
                                sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"></input>");
                            }
                        } else {
                            sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" value=\"" + replaceValue + "\"></input>");
                        }
                    }
                    sb.append("</td>");
                    sb.append("</sec:accesscontrollist>");
                }
                // 根据添加tr集合和补位td集合,补充html
                for (int j = 0; j < addTr.size(); j++) {
                    if (addTr.get(j) == i) {
                        for (int k = 0; k < addTd.get(j); k++) {
                            sb.append("<th></th><td></td>");
                        }
                        sb.append("</tr><tr>");
                    }
                }
            }
        }
        String r = "";
        if ((sb.length() - 4) == sb.lastIndexOf("<tr>")) {
            r = sb.substring(0, sb.length() - 4);
        } else {
            r = sb + "</tr>";
        }
        return r;
    }

    /**
     * 获取动态EDIT页面HTML
     *
     * @param formShowList 动态字段数据集合
     * @param mapCode      通用代码字符串
     * @param param        {
     *                     MODEL_CODE: 模块CODE,
     *                     FORM_CODE: 表单CODE,
     *                     MODEL_COLUMN: 模板显示列数,
     *                     COL_SPAN: 对应字段跨列数组,
     *                     ROW_SPAN: 对应字段跨行数组
     *                     }
     * @return
     * @throws Exception
     */
    @Override
    public String getDynamicEditHtml(List<Map<String, Object>> formShowList, Map<String, Map<String, String>> mapCode, Map<String, Object> param) throws Exception {
        // 定义模板列数样式
        Map<String, String> columnStyle = new HashMap<String, String>();
        // 模板列数
        int modelColumn = 3;
        // 跨列数组
        int[] colSpanIndex = null;
        // 跨行数组
        int[] rowSpanIndex = null;
        // 模块Code
        String modelCode = "";
        // 表单Code
        String formCode = "";
        if (null != param) {
            modelCode = (String) param.get("MODEL_CODE");
            formCode = (String) param.get("FORM_CODE");
            modelColumn = Integer.parseInt(param.get("MODEL_COLUMN") + "");
            // colspan list转数组
            List<Integer> colSpanList = (List<Integer>) param.get("COL_SPAN");
            if (colSpanList.size() > 0 && colSpanList.size() == formShowList.size()) {
                colSpanIndex = new int[colSpanList.size()];
                for (int i = 0; i < colSpanList.size(); i++) {
                    colSpanIndex[i] = colSpanList.get(i);
                }
            } else {
                colSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < colSpanIndex.length; i++) {
                    colSpanIndex[i] = 1;
                }
            }
            // rowspan list转数组
            List<Integer> rowSpanList = (List<Integer>) param.get("ROW_SPAN");
            if (rowSpanList.size() > 0 && rowSpanList.size() == formShowList.size()) {
                rowSpanIndex = new int[rowSpanList.size()];
                for (int i = 0; i < rowSpanList.size(); i++) {
                    rowSpanIndex[i] = rowSpanList.get(i);
                }
            } else {
                rowSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < rowSpanIndex.length; i++) {
                    rowSpanIndex[i] = 1;
                }
            }
            if (colSpanList.size() != formShowList.size() || rowSpanList.size() != formShowList.size()) {
                SysLogUtil.log("构建动态编辑页面方法", "构建动态编辑页面方法出错，表单列值和实际列值不符！", OpType.select, OpResult.failure, LogBaseFactory.getLogBase());
            }
        }
        // 选择列宽样式
        switch (modelColumn) {
            case 1:
                columnStyle.put("thWidth", "35%");
                columnStyle.put("tdWidth", "65%");
                break;
            case 2:
                columnStyle.put("thWidth", "15%");
                columnStyle.put("tdWidth", "35%");
                break;
            case 3:
                columnStyle.put("thWidth", "10%");
                columnStyle.put("tdWidth", "23%");
                break;
            case 4:
                columnStyle.put("thWidth", "8%");
                columnStyle.put("tdWidth", "17%");
                break;
            default:
                columnStyle.put("thWidth", "20%");
                columnStyle.put("tdWidth", "80%");
                break;
        }
        // 计算数
        int sum = 0;
        // 添加tr下标
        List<Integer> addTr = new ArrayList<Integer>();
        // 补位td下标
        List<Integer> addTd = new ArrayList<Integer>();
        for (int i = 0; i < colSpanIndex.length; i++) {
            sum += colSpanIndex[i];
            // 如果计算数等于模板列数,则需进行换行,记录下标
            if (sum == modelColumn) {
                // 记录换行下标
                addTr.add(i);
                // 记录补位数
                addTd.add(0);
                // 清空计算数
                sum = 0;
            }
            // 判断索引是否可以循环下一次
            if (i < colSpanIndex.length - 1) {
                // 计算数累加下一下标跨列数
                int nextSum = sum + colSpanIndex[i + 1];
                // 如果累加下一跨列数大于模板列数,则记录换行下标,并记录补位数
                if (nextSum > modelColumn) {
                    // 记录换行下标
                    addTr.add(i);
                    // 记录补位数
                    addTd.add(modelColumn - sum);
                    // 清空计算数
                    sum = 0;
                }
            }
        }
        StringBuffer sb = new StringBuffer();
        sb.append("<tr>");
        for (int i = 0; i < modelColumn; i++) {
            sb.append("<th width='" + columnStyle.get("thWidth") + "'></th><td width='" + columnStyle.get("tdWidth") + "'></td>");
        }
        sb.append("</tr>");
        sb.append("<tr>");
        String requiredCode = ",validType:'comboRequired'";
        if (null != formShowList) {
            // 获取设置组合项字段
            List<Map<String, Object>> columnList = new ArrayList<Map<String, Object>>();
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                String colGeneMethod = (String) cc.get("COL_GENE_METHOD");
                String groupConfigStr = (String) cc.get("GROUP_CONFIG");
                String colDropdownType = (String) cc.get("COL_DROPDOWN_TYPE");
                // 如果生成方式是组合项
                if (null != colGeneMethod && "4".equals(colGeneMethod)) {
                    List<Map<String, Object>> groupList = commTableManagerIntfsService.getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs((String) cc.get("ID"));
                    // 将组合项字段的config字符串追加到每个设置字段中
                    for (int j = 0; j < groupList.size(); j++) {
                        Map<String, Object> groupMap = groupList.get(j);
                        groupMap.put("GROUP_CONFIG_STR", groupConfigStr);
                        groupMap.put("COL_DROPDOWN_TYPE", colDropdownType);
                        groupMap.put("COL_TYPE", cc.get("COL_TYPE"));
                        columnList.add(groupMap);
                    }
                }
            }
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                String sd = cc.get("COL_NAME").toString();
                // 判断当前字段是否被设置组合项
                boolean isSet = false;
                List<Map<String, Object>> groupColList = new ArrayList<Map<String, Object>>();
                for (int j = 0; j < columnList.size(); j++) {
                    Map<String, Object> groupCol = columnList.get(j);
                    if (cc.get("ID").equals(groupCol.get("TARGET_COLUMN_ID"))) {
                        isSet = true;
                        groupColList.add(groupCol);
                    }
                }
                String isMast = "";
                String labelbg = "";
                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                    isMast = "true";
                    labelbg = "remind";
                } else {
                    isMast = "false";
                }
                String length = "";
                if (cc.get("COL_LENGTH") != null) {
                    length = ",validType:'length[0," + cc.get("COL_LENGTH") + "]'";
                }
                // 参选
                if ("1".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + length + "\" class=\"easyui-combobox\" name=\""
                                            + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                } else {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + length
                                            + "\" class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\">");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                }
                            }
                        }
                    }
                } else if ("2".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"false\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + "\" class=\"easyui-combobox\" name=\""
                                            + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >"); // + length
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                } else {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    String requiredString = "";
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("*");
                                        requiredString = requiredCode;
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"false\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'" + requiredString + ",required:" + isMast + "\" class=\"easyui-combobox input-readonly\" name=\""
                                            + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\">"); // + length
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                }
                            }
                        }
                    }
                    // 如果为选择
                } else if ("3".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    if ("user".equals(cc.get("COL_RULE_NAME"))) {
                        // String ww = (String) cc.get("COL_NAME");
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：user，那么该字段为选人页
                            // 字段可编辑，根据ID创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) +
                                // "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + (null ==
                                // cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME"))
                                        + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) +
                                // "\" id=\"" + cc.get("COL_NAME") + "NAME" + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE")
                                // || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME"))
                                        + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + (null == (String) param.get("RESPONSIBLE_USER_ID") || ("null".equals((String) param.get("RESPONSIBLE_USER_ID"))) ? "" : (String) param.get("RESPONSIBLE_USER_ID")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        } else {
                            // 如果为生成规则英文字段为：user，那么该字段为选人页
                            // 字段不可编辑，在原ID基础上加1，不能创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" :
                                // cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + (null ==
                                // cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\""
                                        + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "1\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" :
                                // cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE")
                                // || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\""
                                        + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "NAME" + "1\" id=\"" + cc.get("COL_NAME") + "NAME" + "1\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        }
                    } else if ("dept".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                            // 字段可编辑，根据ID创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) +
                                // "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + (null ==
                                // cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME"))
                                        + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) +
                                // "\" id=\"" + cc.get("COL_NAME") + "NAME" + "\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE")
                                // || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME"))
                                        + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + (null == (String) param.get("ARCHIVE_DEPT_ID") || ("null".equals((String) param.get("ARCHIVE_DEPT_ID"))) ? "" : (String) param.get("ARCHIVE_DEPT_ID")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        } else {
                            // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                            // 字段不可编辑，在原ID基础上加1，不能创建选人页
                            if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" :
                                // cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\" type=\"hidden\" value=\"" + (null ==
                                // cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\""
                                        + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "_ID" + "\" id=\"" + cc.get("COL_NAME") + "_ID" + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "1\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            } else {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\">");
                                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                    sb.append("*");
                                }
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                // sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") +
                                // "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" :
                                // cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" + "1\"></input>");
                                // sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE")
                                // || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" value=\""
                                        + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"></input>");
                                sb.append("<input name=\"" + cc.get("COL_NAME") + "NAME" + "1\" id=\"" + cc.get("COL_NAME") + "NAME" + "1\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");

                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        }
                    } else if ("custom".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                            // 字段可编辑，根据图片点击事件创建弹出页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("*");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<div style=\"position: relative; \">");
                            sb.append("<input title=\"_" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" value=\""
                                    + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"> <input title=\"" + cc.get("COL_LABEL") + "NAME" + "\" class=\"easyui-validatebox\" type=\"text\" id=\"" + cc.get("COL_NAME") + "NAME"
                                    + "\" onclick=\"getKmNoumenon('" + cc.get("CUSTOM_PATH") + "','" + cc.get("COL_RULE_TITLE") + "','" + cc.get("COL_NAME") + "');\" style=\"cursor: pointer\" data-options=\"required:" + isMast + length + "\" value=\""
                                    + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" readonly=\"readonly\">");
                            sb.append("<img src=\"avicit/platform6/component/css/commonselection/icons_ext/selectorCommon.gif\" style=\"display: block; z-index: 800; position: absolute; float: right; top: 3px; cursor: pointer; right: -3px;\" onclick=\"getKmNoumenon('"
                                    + cc.get("CUSTOM_PATH") + "','" + cc.get("COL_RULE_TITLE") + "','" + cc.get("COL_NAME") + "');\" />");
                            sb.append("</div>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                            // 字段不可编辑，去掉图片点击事件就不能创建弹出页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("*");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<div style=\"position: relative; \">");
                            sb.append("<input title=\"_" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" value=\""
                                    + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"> <input title=\"" + cc.get("COL_LABEL") + "NAME" + "\" class=\"easyui-validatebox input-readonly\" type=\"text\" id=\""
                                    + cc.get("COL_NAME") + "NAME" + "\" style=\"cursor: pointer\" data-options=\"required:" + isMast + length + "\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME"))
                                    + "\" readonly=\"readonly\"> <img src=\"avicit/platform6/component/css/commonselection/icons_ext/selectorCommon.gif");
                            sb.append("	style=\"display: block; z-index: 800; position: absolute; float: right; top: 3px; cursor: pointer; right: -3px;\" />");
                            sb.append("</div>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    }
                } else {
                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                    sb.append("<th><span class=\"" + labelbg + "\">");
                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                        sb.append("*");
                    }
                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                    if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                        sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    } else {
                        sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    }
                    if ("integer".equals(cc.get("COL_TYPE"))) {
                        if (isSet) {
                            // 设置组合项的字段名，多个以；隔开
                            String sourceColName = "";
                            // 设置组合项的配置字符串，多个以|隔开
                            String sourceConfigStr = "";
                            // 设置组合项的字段类型
                            String sourceColType = "";
                            // 设置组合项的字段下拉类型
                            String sourceColDropdownType = "";
                            for (int j = 0; j < groupColList.size(); j++) {
                                Map<String, Object> groupColMap = groupColList.get(j);
                                if ("".equals(sourceColName)) {
                                    sourceColName = (String) groupColMap.get("COL_NAME");
                                    sourceColType = (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType = (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                } else {
                                    sourceColName += ";" + (String) groupColMap.get("COL_NAME");
                                    sourceColType += ";" + (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType += ";" + (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                }
                                if ("".equals(sourceConfigStr)) {
                                    sourceConfigStr = (String) groupColMap.get("GROUP_CONFIG_STR");
                                } else {
                                    sourceConfigStr += "|" + (String) groupColMap.get("GROUP_CONFIG_STR");
                                }
                            }
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append(" onkeyup=\"changeGroup('" + sourceColName + "','" + sourceColType + "','" + sourceColDropdownType + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "', '" + sourceConfigStr + "');\"");
                                    sb.append(" />");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" value=\""
                                        + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:0\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" value=\""
                                        + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        }
                    } else if ("float".equals(cc.get("COL_TYPE"))) {
                        if (isSet) {
                            // 设置组合项的字段名，多个以；隔开
                            String sourceColName = "";
                            // 设置组合项的配置字符串，多个以|隔开
                            String sourceConfigStr = "";
                            // 设置组合项的字段类型
                            String sourceColType = "";
                            // 设置组合项的字段下拉类型
                            String sourceColDropdownType = "";
                            for (int j = 0; j < groupColList.size(); j++) {
                                Map<String, Object> groupColMap = groupColList.get(j);
                                if ("".equals(sourceColName)) {
                                    sourceColName = (String) groupColMap.get("COL_NAME");
                                    sourceColType = (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType = (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                } else {
                                    sourceColName += ";" + (String) groupColMap.get("COL_NAME");
                                    sourceColType += ";" + (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType += ";" + (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                }
                                if ("".equals(sourceConfigStr)) {
                                    sourceConfigStr = (String) groupColMap.get("GROUP_CONFIG_STR");
                                } else {
                                    sourceConfigStr += "|" + (String) groupColMap.get("GROUP_CONFIG_STR");
                                }
                            }
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append(" onkeyup=\"changeGroup('" + sourceColName + "','" + sourceColType + "','" + sourceColDropdownType + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "', '" + sourceConfigStr + "');\"");
                                    sb.append(" />");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" data-options=\"required:" + isMast + length
                                        + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append("data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"");
                                    sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                } else {
                                    sb.append("<input class=\"easyui-numberbox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                    sb.append(" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                                }
                            } else {
                                sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" data-options=\"required:" + isMast + length
                                        + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        }
                    } else if ("date".equals(cc.get("COL_TYPE"))) {
                        if (isSet) {

                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                sb.append("<input class=\"easyui-datebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md', onSelect: changeGroupValueByDate,required:" + isMast
                                        + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            } else {
                                sb.append("<input class=\"easyui-datebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                        + "\" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md'\" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                sb.append("<input class=\"easyui-datebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md',required:" + isMast
                                        + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            } else {
                                sb.append("<input class=\"easyui-datebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                        + "\" data-options=\"onShowPanel:comboboxOnShowPanel,validType:'md'\" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                            }
                        }
                    } else if ("string".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        if (isSet) {
                            // 设置组合项的字段名，多个以；隔开
                            String sourceColName = "";
                            // 设置组合项的配置字符串，多个以|隔开
                            String sourceConfigStr = "";
                            // 设置组合项的字段类型
                            String sourceColType = "";
                            // 设置组合项的字段下拉类型
                            String sourceColDropdownType = "";
                            for (int j = 0; j < groupColList.size(); j++) {
                                Map<String, Object> groupColMap = groupColList.get(j);
                                if ("".equals(sourceColName)) {
                                    sourceColName = (String) groupColMap.get("COL_NAME");
                                    sourceColType = (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType = (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                } else {
                                    sourceColName += ";" + (String) groupColMap.get("COL_NAME");
                                    sourceColType += ";" + (String) groupColMap.get("COL_TYPE");
                                    sourceColDropdownType += ";" + (String) groupColMap.get("COL_DROPDOWN_TYPE");
                                }
                                if ("".equals(sourceConfigStr)) {
                                    sourceConfigStr = (String) groupColMap.get("GROUP_CONFIG_STR");
                                } else {
                                    sourceConfigStr += "|" + (String) groupColMap.get("GROUP_CONFIG_STR");
                                }
                            }
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (String.valueOf(cc.get("COL_NAME")).equals("ARCHIVE_CODE")) {
                                    // System.out.println(String.valueOf(cc.get("COL_NAME")));
                                }
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    if (rowSpanIndex[i] > 1) {
                                        sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                                + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" ");
                                        sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\">" + replaceValue + "</textarea>");
                                    } else {
                                        sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                        sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                    }
                                } else {
                                    if (rowSpanIndex[i] > 1) {
                                        sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                                + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" >" + replaceValue + "</textarea>");
                                    } else {
                                        sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                        sb.append("onkeyup=\"changeGroup('" + sourceColName + "','" + sourceColType + "','" + sourceColDropdownType + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "', '" + sourceConfigStr + "');\"");
                                        sb.append("/>");
                                    }
                                }
                            } else {
                                if (rowSpanIndex[i] > 1) {
                                    sb.append("<textarea class=\"textarea easyui-validatebox input-readonly\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\""
                                            + cc.get("COL_NAME") + "\"  readonly=\"readonly\" >" + replaceValue + "</textarea>");
                                } else {
                                    sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" value=\"" + replaceValue
                                            + "\"></input>");
                                }
                            }
                        } else {
                            if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                                if (String.valueOf(cc.get("COL_NAME")).equals("ARCHIVE_CODE")) {
                                    // System.out.println(String.valueOf(cc.get("COL_NAME")));
                                }
                                if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                    if (rowSpanIndex[i] > 1) {
                                        sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                                + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" ");
                                        sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\">" + replaceValue + "</textarea>");
                                    } else {
                                        sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                        sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                                    }
                                } else {
                                    if (rowSpanIndex[i] > 1) {
                                        sb.append("<textarea class=\"inputbox easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME")
                                                + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" >" + replaceValue + "</textarea>");
                                    } else {
                                        sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                        sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"></input>");
                                    }
                                }
                            } else {
                                if (rowSpanIndex[i] > 1) {
                                    sb.append("<textarea class=\"textarea easyui-validatebox input-readonly\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\""
                                            + cc.get("COL_NAME") + "\"  readonly=\"readonly\" >" + replaceValue + "</textarea>");
                                } else {
                                    sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" value=\"" + replaceValue
                                            + "\"></input>");
                                }
                            }
                        }
                    } else if ("clob".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            String groupStr = String.valueOf(cc.get("GROUP_CONFIG"));
                            if (null != groupStr && !"".equals(groupStr) && !"null".equals(groupStr)) {
                                sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"");
                                sb.append("onfocus=\"groupConfig('" + cc.get("COL_DROPDOWN_TYPE") + "','" + cc.get("COL_TYPE") + "','" + cc.get("COL_NAME") + "','" + groupStr + "');\"></input>");
                            } else {
                                sb.append("<input class=\"easyui-validatebox\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"></input>");
                            }
                        } else {
                            sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"  readonly=\"readonly\" value=\"" + replaceValue + "\"></input>");
                        }
                    }
                    sb.append("</td>");
                    sb.append("</sec:accesscontrollist>");
                }
                // 根据添加tr集合和补位td集合,补充html
                for (int j = 0; j < addTr.size(); j++) {
                    if (addTr.get(j) == i) {
                        for (int k = 0; k < addTd.get(j); k++) {
                            sb.append("<th></th><td></td>");
                        }
                        sb.append("</tr><tr>");
                    }
                }
            }
        }
        String r = "";
        if ((sb.length() - 4) == sb.lastIndexOf("<tr>")) {
            r = sb.substring(0, sb.length() - 4);
        } else {
            r = sb + "</tr>";
        }
        return r;
    }

    /**
     * 获取动态DETAIL页面HTML
     *
     * @param formShowList 动态字段数据集合
     * @param mapCode      通用代码字符串
     * @param param        {
     *                     MODEL_CODE: 模块CODE,
     *                     FORM_CODE: 表单CODE,
     *                     MODEL_COLUMN: 模板显示列数,
     *                     COL_SPAN: 对应字段跨列数组,
     *                     ROW_SPAN: 对应字段跨行数组
     *                     }
     * @return
     * @throws Exception
     */
    @Override
    public String getDynamicDetailHtml(List<Map<String, Object>> formShowList, Map<String, Map<String, String>> mapCode, Map<String, Object> param) throws Exception {
        // 定义模板列数样式
        Map<String, String> columnStyle = new HashMap<String, String>();
        // 模板列数
        int modelColumn = 3;
        // 跨列数组
        int[] colSpanIndex = null;
        // 跨行数组
        int[] rowSpanIndex = null;
        // 模块Code
        String modelCode = "";
        // 表单Code
        String formCode = "";
        //zcl 2019-11-04 档案整理详情页不添加必填校验
        String isNotMust = "";
        if (null != param) {
        	if(param.containsKey("isNotMust")){
        		isNotMust = (String) param.get("isNotMust");
        	}
            modelCode = (String) param.get("MODEL_CODE");
            formCode = (String) param.get("FORM_CODE");
            modelColumn = Integer.parseInt(param.get("MODEL_COLUMN") + "");
            // colspan list转数组
            List<Integer> colSpanList = (List<Integer>) param.get("COL_SPAN");
            if (colSpanList.size() > 0 && colSpanList.size() == formShowList.size()) {
                colSpanIndex = new int[colSpanList.size()];
                for (int i = 0; i < colSpanList.size(); i++) {
                    colSpanIndex[i] = colSpanList.get(i);
                }
            } else {
                colSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < colSpanIndex.length; i++) {
                    colSpanIndex[i] = 1;
                }
            }
            // rowspan list转数组
            List<Integer> rowSpanList = (List<Integer>) param.get("ROW_SPAN");
            if (rowSpanList.size() > 0 && rowSpanList.size() == formShowList.size()) {
                rowSpanIndex = new int[rowSpanList.size()];
                for (int i = 0; i < rowSpanList.size(); i++) {
                    rowSpanIndex[i] = rowSpanList.get(i);
                }
            } else {
                rowSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < rowSpanIndex.length; i++) {
                    rowSpanIndex[i] = 1;
                }
            }
            if (colSpanList.size() != formShowList.size() || rowSpanList.size() != formShowList.size()) {
                SysLogUtil.log("构建动态详细页面方法", "构建动态详细页面方法出错，表单列值和实际列值不符！", OpType.select, OpResult.failure, LogBaseFactory.getLogBase());
            }
        }
        // 选择列宽样式
        switch (modelColumn) {
            case 1:
                columnStyle.put("thWidth", "13%");
                columnStyle.put("tdWidth", "87%");
                break;
            case 2:
                columnStyle.put("thWidth", "15%");
                columnStyle.put("tdWidth", "35%");
                break;
            case 3:
                columnStyle.put("thWidth", "10%");
                columnStyle.put("tdWidth", "23%");
                break;
            case 4:
                columnStyle.put("thWidth", "8%");
                columnStyle.put("tdWidth", "17%");
                break;
            default:
                columnStyle.put("thWidth", "20%");
                columnStyle.put("tdWidth", "80%");
                break;
        }
        // 计算数
        int sum = 0;
        // 添加tr下标
        List<Integer> addTr = new ArrayList<Integer>();
        // 补位td下标
        List<Integer> addTd = new ArrayList<Integer>();
        for (int i = 0; i < colSpanIndex.length; i++) {
            sum += colSpanIndex[i];
            // 如果计算数等于模板列数,则需进行换行,记录下标
            if (sum == modelColumn) {
                // 记录换行下标
                addTr.add(i);
                // 记录补位数
                addTd.add(0);
                // 清空计算数
                sum = 0;
            }
            // 判断索引是否可以循环下一次
            if (i < colSpanIndex.length - 1) {
                // 计算数累加下一下标跨列数
                int nextSum = sum + colSpanIndex[i + 1];
                // 如果累加下一跨列数大于模板列数,则记录换行下标,并记录补位数
                if (nextSum > modelColumn) {
                    // 记录换行下标
                    addTr.add(i);
                    // 记录补位数
                    addTd.add(modelColumn - sum);
                    // 清空计算数
                    sum = 0;
                }
            }
        }
        StringBuffer sb = new StringBuffer();
        sb.append("<tr>");
        for (int i = 0; i < modelColumn; i++) {
            sb.append("<th width='" + columnStyle.get("thWidth") + "'></th><td width='" + columnStyle.get("tdWidth") + "'></td>");
        }
        sb.append("</tr>");
        sb.append("<tr>");
        if (null != formShowList) {
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                String isMast = "";
                String labelbg = "";
                if(StringUtils.isEmpty(isNotMust)){
                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                        isMast = "true";
                        labelbg = "";
                    } else {
                        isMast = "false";
                    }
                }else{
                	 isMast = "false";
                }
                String length = "";
                if (cc.get("COL_LENGTH") != null) {
                    length = ",validType:'length[0," + cc.get("COL_LENGTH") + "]'";
                }
                // 参选
                if ("1".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("");
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\" data-options=\"required:" + isMast + length + "\" readonly=\"readonly\"");
                                    sb.append("class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                } else {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("");
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"true\" data-options=\"required:" + isMast + length + "\"");
                                    sb.append("class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" readonly=\"readonly\">");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                }
                            }
                        }
                    }
                } else if ("2".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("");
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"false\" data-options=\"required:" + isMast + length + "\" readonly=\"readonly\"");
                                    sb.append("class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" >");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                } else {
                                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                                    sb.append("<th><span class=\"" + labelbg + "\">");
                                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                        sb.append("");
                                    }
                                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                    sb.append("<select title=\"" + cc.get("COL_LABEL") + "\" editable=\"false\" data-options=\"required:" + isMast + length + "\"");
                                    sb.append("class=\"easyui-combobox input-readonly\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" readonly=\"readonly\">");
                                    Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                    boolean isHaveValue = false;
                                    while (iteratorCode.hasNext()) {
                                        String lookupCode = String.valueOf(iteratorCode.next());
                                        String lookupName = codeValue.get(lookupCode);
                                        if (cc.get("COL_VALUE").equals(lookupCode)) {
                                            isHaveValue = true;
                                            sb.append("<option value=\"" + lookupCode + "\" selected=\"selected\">" + lookupName + "</option>");
                                        } else {
                                            sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                        }
                                    }
                                    if (isHaveValue == false) {
                                        sb.append("<option value=\"" + cc.get("COL_VALUE") + "\" selected=\"selected\">" + cc.get("COL_VALUE") + "</option>");
                                    }
                                    sb.append("</select>");
                                    sb.append("</td>");
                                    sb.append("</sec:accesscontrollist>");
                                }
                            }
                        }
                    }
                    // 如果为选择
                } else if ("3".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    if ("user".equals(cc.get("COL_RULE_NAME"))) {
                        // String ww = (String) cc.get("COL_NAME");
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：user，那么该字段为选人页
                            // 字段可编辑，根据ID创建选人页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("");
                            }
                            if("责任者".equals(cc.get("COL_LABEL"))){
                                sb.append("</span>形成单位：</th>");
                            }else{
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            }

                            sb.append("<td class=\"input-readonly nit\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\" readonly=\"readonly\"");
                            sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"\"" + cc.get("COL_NAME") + "NAME" + "\"></input>");
                            sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"/>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            // 如果为生成规则英文字段为：user，那么该字段为选人页
                            // 字段不可编辑，在原ID基础上加1，不能创建选人页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                            sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME1" + "\"></input>");
                            sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"/>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    } else if ("dept".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                            // 字段可编辑，根据ID创建选人页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                            sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME" + "\"></input>");
                            sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                            // 字段不可编辑，在原ID基础上加1，不能创建选人页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input data-options=\"required:" + isMast + length + "\" title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" readonly=\"readonly\"");
                            sb.append("value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" id=\"" + cc.get("COL_NAME") + "NAME1" + "\"></input>");
                            sb.append("<input name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" type=\"hidden\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\" />");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    } else if ("custom".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                            // 字段可编辑，根据图片点击事件创建弹出页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<div style=\"position: relative;\">");
                            sb.append("<input title=\"_" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" value=\""
                                    + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\">");
                            sb.append("<input title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" type=\"text\" id=\"" + cc.get("COL_NAME") + "NAME" + "\" onclick=\"getKmNoumenon('" + cc.get("CUSTOM_PATH") + "','" + cc.get("COL_RULE_TITLE") + "','"
                                    + cc.get("COL_NAME") + "');\" style=\"cursor: pointer\" data-options=\"required:" + isMast + length + "\" value=\"" + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" readonly=\"readonly\">");
                            sb.append("</div>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                            // 字段不可编辑，去掉图片点击事件就不能创建弹出页
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\">");
                            if ("Y".equals(cc.get("COL_IS_MUST"))) {
                                sb.append("");
                            }
                            sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<div style=\"position: relative; \">");
                            sb.append("<input title=\"_" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" value=\""
                                    + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\">");
                            sb.append("<input title=\"" + cc.get("COL_LABEL") + "\" class=\"easyui-validatebox input-readonly\" type=\"text\" id=\"" + cc.get("COL_NAME") + "NAME" + "\" style=\"cursor: pointer\" data-options=\"required:" + isMast + length + "\" value=\""
                                    + (cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")) + "\" readonly=\"readonly\">");
                            sb.append("</div>");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    }
                } else {
                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject =\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                    sb.append("<th><span class=\"" + labelbg + "\">");
                    if ("Y".equals(cc.get("COL_IS_MUST"))) {
                        sb.append("");
                    }
                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                    if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                        sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    } else {
                        sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    }
                    if ("integer".equals(cc.get("COL_TYPE"))) {
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                        } else {
                            sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                        }
                    } else if ("float".equals(cc.get("COL_TYPE"))) {
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE")) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                        } else {
                            sb.append("<input class=\"easyui-numberbox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + ",precision:" + cc.get("COL_DECIMAL") + "\" value=\"" + (null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE")) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                        }
                    } else if ("date".equals(cc.get("COL_TYPE"))) {
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            sb.append("<input class=\"easyui-datebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\"");
                            sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + "\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                        } else {
                            sb.append("<input class=\"easyui-datebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" value=\"" + (null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")) + "\"></input>");
                        }
                    } else if ("string".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            if (rowSpanIndex[i] > 1) {
                                sb.append("<textarea class=\"textarea easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + "\">" + replaceValue + "</textarea>");
                            } else {
                                sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"></input>");
                            }
                        } else {
                            if (rowSpanIndex[i] > 1) {
                                sb.append("<textarea class=\"textarea easyui-validatebox\" style=\"height: " + rowSpanIndex[i] * 20 + "px !important;\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" >" + replaceValue + "</textarea>");
                            } else {
                                sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                                sb.append(" readonly=\"readonly\" value=\"" + replaceValue + "\"></input>");
                            }
                        }
                    } else if ("clob".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        if ("Y".equals(cc.get("COL_IS_EDIT"))) {
                            sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" data-options=\"required:" + isMast + length + "\" value=\"" + replaceValue + "\"></input>");
                        } else {
                            sb.append("<input class=\"easyui-validatebox input-readonly\" title='" + cc.get("COL_LABEL") + "' type=\"text\" name=\"" + cc.get("COL_NAME") + "\" id=\"" + cc.get("COL_NAME") + "\" ");
                            sb.append(" readonly=\"readonly\" value=\"" + replaceValue + "\"></input>");
                        }
                    }
                    sb.append("</td>");
                    sb.append("</sec:accesscontrollist>");
                }
                // 根据添加tr集合和补位td集合,补充html
                for (int j = 0; j < addTr.size(); j++) {
                    if (addTr.get(j) == i) {
                        for (int k = 0; k < addTd.get(j); k++) {
                            sb.append("<th></th><td></td>");
                        }
                        sb.append("</tr><tr>");
                    }
                }
            }
        }
        String r = "";
        if ((sb.length() - 4) == sb.lastIndexOf("<tr>")) {
            r = sb.substring(0, sb.length() - 4);
        } else {
            r = sb + "</tr>";
        }
        return r;
    }

    /**
     * 获取动态SEARCH页面HTML
     *
     * @param formShowList 动态字段数据集合
     * @param mapCode      通用代码字符串
     * @param param        {
     *                     MODEL_CODE: 模块CODE,必填
     *                     FORM_CODE: 表单CODE,必填
     *                     ALIAS_NAME: 选人选部门别名,可为空
     *                     MODEL_COLUMN: 模板显示列数,可为空
     *                     COL_SPAN: 对应字段跨列数组,可为空
     *                     ROW_SPAN: 对应字段跨行数组,可为空
     *                     PUBLIC_FLAG: 是否为公共字段表单(Y:是, N:否)
     *                     }
     * @return
     * @throws Exception
     */
    @Override
    public String getDynamicSearchHtml(List<Map<String, Object>> formShowList, Map<String, Map<String, String>> mapCode, Map<String, Object> param) throws Exception {
        // 定义模板列数样式
        Map<String, String> columnStyle = new HashMap<String, String>();
        // 模板列数
        int modelColumn = 3;
        // 跨列数组
        int[] colSpanIndex = null;
        // 跨行数组
        int[] rowSpanIndex = null;
        // 模块Code
        String modelCode = "";
        // 表单Code
        String formCode = "";
        // 选人选部门别名
        String aliasName = "";
        if (null != param) {
            modelCode = (String) param.get("MODEL_CODE");
            formCode = (String) param.get("FORM_CODE");
            if (null != param.get("ALIAS_NAME")) {
                aliasName = (String) param.get("ALIAS_NAME");
                aliasName = "_" + aliasName;
            }
            modelColumn = Integer.parseInt(param.get("MODEL_COLUMN") + "");
            // colspan list转数组
            List<Integer> colSpanList = new ArrayList<Integer>();// (List<Integer>)param.get("COL_SPAN"); //查询区域不需要多行多列展示,执行默认操作
            if (colSpanList.size() > 0 && colSpanList.size() == formShowList.size()) {
                colSpanIndex = new int[colSpanList.size()];
                for (int i = 0; i < colSpanList.size(); i++) {
                    colSpanIndex[i] = colSpanList.get(i);
                }
            } else {
                colSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < colSpanIndex.length; i++) {
                    colSpanIndex[i] = 1;
                }
            }
            // rowspan list转数组
            List<Integer> rowSpanList = new ArrayList<Integer>();// (List<Integer>)param.get("ROW_SPAN"); //查询区域不需要多行多列展示,执行默认操作
            if (rowSpanList.size() > 0 && rowSpanList.size() == formShowList.size()) {
                rowSpanIndex = new int[rowSpanList.size()];
                for (int i = 0; i < rowSpanList.size(); i++) {
                    rowSpanIndex[i] = rowSpanList.get(i);
                }
            } else {
                rowSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < rowSpanIndex.length; i++) {
                    rowSpanIndex[i] = 1;
                }
            }
            // if (colSpanList.size() != formShowList.size() || rowSpanList.size() != formShowList.size()) {
            // SysLogUtil.log("构建动态查询页面方法", "构建动态查询页面方法出错，表单列值和实际列值不符！", OpType.select, OpResult.failure, LogBaseFactory.getLogBase());
            // }
        }
        // 选择列宽样式
        switch (modelColumn) {
            case 1:
                columnStyle.put("thWidth", "20%");
                columnStyle.put("tdWidth", "80%");
                break;
            case 2:
                columnStyle.put("thWidth", "15%");
                columnStyle.put("tdWidth", "35%");
                break;
            case 3:
                columnStyle.put("thWidth", "10%");
                columnStyle.put("tdWidth", "23%");
                break;
            case 4:
                columnStyle.put("thWidth", "8%");
                columnStyle.put("tdWidth", "17%");
                break;
            default:
                columnStyle.put("thWidth", "20%");
                columnStyle.put("tdWidth", "80%");
                break;
        }
        // 计算数
        int sum = 0;
        // 添加tr下标
        List<Integer> addTr = new ArrayList<Integer>();
        // 补位td下标
        List<Integer> addTd = new ArrayList<Integer>();
        for (int i = 0; i < colSpanIndex.length; i++) {
            sum += colSpanIndex[i];
            // 如果计算数等于模板列数,则需进行换行,记录下标
            if (sum == modelColumn) {
                // 记录换行下标
                addTr.add(i);
                // 记录补位数
                addTd.add(0);
                // 清空计算数
                sum = 0;
            }
            // 判断索引是否可以循环下一次
            if (i < colSpanIndex.length - 1) {
                // 计算数累加下一下标跨列数
                int nextSum = sum + colSpanIndex[i + 1];
                // 如果累加下一跨列数大于模板列数,则记录换行下标,并记录补位数
                if (nextSum > modelColumn) {
                    // 记录换行下标
                    addTr.add(i);
                    // 记录补位数
                    addTd.add(modelColumn - sum);
                    // 清空计算数
                    sum = 0;
                }
            }
        }
        StringBuffer sb = new StringBuffer();
        sb.append("<tr>");
        for (int i = 0; i < modelColumn; i++) {
            sb.append("<th width='" + columnStyle.get("thWidth") + "'></th><td width='" + columnStyle.get("tdWidth") + "'></td>");
        }
        sb.append("</tr>");
        sb.append("<tr>");
        String publicFlag = (String) param.get("PUBLIC_FLAG");
        if (null != formShowList) {
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                // String isMast = "";
                String labelbg = "";
                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                    // isMast = "true";
                    labelbg = "remind";
                } else {
                    // isMast = "false";
                }
                String length = "";
                if (cc.get("COL_LENGTH") != null) {
                    length = "validType:'length[0," + cc.get("COL_LENGTH") + "]'";
                }
                // 如果为生成规则英文字段为：code，那么该字段为通用代码
                if ("1".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            if (codeValue != null) {
                                if (null != publicFlag && "Y".equals(publicFlag)) {
                                    sb.append("<select title=\"" + (String) cc.get("COL_LABEL") + "\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'\" editable=\"true\" class=\"easyui-combobox\" name=\"SELE_" + (String) cc.get("COL_NAME")
                                            + "_CODE\" id=\"SELE_" + (String) cc.get("COL_NAME") + "_CODE\" >");
                                } else {
                                    sb.append("<select title=\"" + (String) cc.get("COL_LABEL") + "\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'\" editable=\"true\" class=\"easyui-combobox\" name=\"SELE_" + (String) cc.get("COL_NAME") + "\" id=\"SELE_"
                                            + (String) cc.get("COL_NAME") + "\" >");
                                }
                                // sb.append("<option value=\"\"></option>");
                                Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                while (iteratorCode.hasNext()) {
                                    String lookupCode = String.valueOf(iteratorCode.next());
                                    String lookupName = codeValue.get(lookupCode);
                                    sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                }
                                sb.append("</select>");
                            }
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    }
                } else if ("2".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + cc.get("COL_NAME") + "\">");
                                sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                if (null != publicFlag && "Y".equals(publicFlag)) {
                                    sb.append("<select title=\"" + (String) cc.get("COL_LABEL") + "\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'\" editable=\"false\" class=\"easyui-combobox\" name=\"SELE_" + (String) cc.get("COL_NAME")
                                            + "_CODE\" id=\"SELE_" + (String) cc.get("COL_NAME") + "_CODE\" >");
                                } else {
                                    sb.append("<select title=\"" + (String) cc.get("COL_LABEL") + "\" data-options=\"onShowPanel:comboboxOnShowPanel,panelHeight:'auto'\" editable=\"false\" class=\"easyui-combobox\" name=\"SELE_" + (String) cc.get("COL_NAME") + "\" id=\"SELE_"
                                            + (String) cc.get("COL_NAME") + "\" >");
                                }
                                // sb.append("<option value=\"\"></option>");
                                Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                while (iteratorCode.hasNext()) {
                                    String lookupCode = String.valueOf(iteratorCode.next());
                                    String lookupName = codeValue.get(lookupCode);
                                    sb.append("<option value=\"" + lookupCode + "\">" + lookupName + "</option>");
                                }
                                sb.append("</select>");
                                sb.append("</td>");
                                sb.append("</sec:accesscontrollist>");
                            }
                        }
                    }// 如果为选择
                } else if ("3".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    if ("user".equals(cc.get("COL_RULE_NAME"))) {
                        // String ww = (String) cc.get("COL_NAME");
                        // 如果为生成规则英文字段为：user，那么该字段为选人页
                        if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input title=\"" + (String) cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" id=\"" + (String) cc.get("COL_NAME") + "_ID" + aliasName + "\" name=\"USER_" + (String) cc.get("COL_NAME") + "_ID" + aliasName
                                    + "\"></input>");
                            sb.append("<input  id=\"USER_" + (String) cc.get("COL_NAME") + aliasName + "\" type=\"hidden\" />");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input  title=\"" + (String) cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" id=\"" + (String) cc.get("COL_NAME") + aliasName + "\" name=\"USER_" + (String) cc.get("COL_NAME") + aliasName + "\"></input>");
                            sb.append("<input  id=\"USER_" + (String) cc.get("COL_NAME") + "NAME" + aliasName + "\" type=\"hidden\" />");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    } else if ("dept".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                        if ("Y".equals(cc.get("IS_COMM_FIELD"))) {// 配置文件中存在该字段
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input  title=\"" + (String) cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" id=\"" + (String) cc.get("COL_NAME") + "_ID" + aliasName + "\" name=\"DEPT_" + (String) cc.get("COL_NAME") + "_ID" + aliasName
                                    + "\"></input>");
                            sb.append("<input id=\"DEPT_" + (String) cc.get("COL_NAME") + aliasName + "\" type=\"hidden\" />");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        } else {
                            sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                            sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                            sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                            sb.append("<input  title=\"" + (String) cc.get("COL_LABEL") + "\" class=\"easyui-validatebox\" readonly=\"readonly\" id=\"" + (String) cc.get("COL_NAME") + aliasName + "\" name=\"DEPT_" + (String) cc.get("COL_NAME") + aliasName + "\"></input>");
                            sb.append("<input id=\"DEPT_" + (String) cc.get("COL_NAME") + "NAME" + aliasName + "\" type=\"hidden\" />");
                            sb.append("</td>");
                            sb.append("</sec:accesscontrollist>");
                        }
                    } else if ("custom".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                        sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                        sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                        sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                        sb.append("<div style=\"position: relative;\">");
                        sb.append("<input title=\"" + (String) cc.get("COL_NAME") + "\" type=\"hidden\" name=\"CUST_" + (String) cc.get("COL_NAME") + "\" id=\"CUST_" + (String) cc.get("COL_NAME") + "\">");
                        sb.append("<input title=\"" + (String) cc.get("COL_LABEL") + "NAME" + "\" class=\"easyui-validatebox\" type=\"text\" id=\"" + (String) cc.get("COL_NAME") + "NAME" + "\" onclick=\"getKmNoumenon('" + (String) cc.get("CUSTOM_PATH") + "','"
                                + (String) cc.get("COL_RULE_TITLE") + "','" + (String) cc.get("COL_NAME")
                                + "');\" style=\"cursor: pointer\"> <img src=\"avicit/platform6/component/css/commonselection/icons_ext/selectorCommon.gif\" style=\"display: block; z-index: 800; position: absolute; float: right; top: 3px; cursor: pointer; right: -3px;\"");
                        sb.append("onclick=\"getKmNoumenon('" + (String) cc.get("CUSTOM_PATH") + "','" + (String) cc.get("COL_RULE_TITLE") + "','" + (String) cc.get("COL_NAME") + "');\" />");
                        sb.append("</div>");
                        sb.append("</td>");
                        sb.append("</sec:accesscontrollist>");
                    }
                } else {
                    sb.append("<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + modelCode + "_" + formCode + "_" + (String) cc.get("COL_NAME") + "\">");
                    sb.append("<th><span class=\"" + labelbg + "\"></span>" + cc.get("COL_LABEL") + "：</th>");
                    sb.append("<td colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    if ("integer".equals(cc.get("COL_TYPE"))) {
                        sb.append("<input class=\"easyui-numberbox\" title='" + (String) cc.get("COL_LABEL") + "' type=\"text\" name=\"INTE_" + (String) cc.get("COL_NAME") + "\" id=\"INTE_" + (String) cc.get("COL_NAME") + "\"  data-options=\"" + length + "\"></input>");
                    } else if ("date".equals(cc.get("COL_TYPE"))) {
                        sb.append("<input class=\"easyui-datebox\" title='" + (String) cc.get("COL_LABEL") + "' type=\"text\" name=\"DATE_" + (String) cc.get("COL_NAME") + "\" id=\"DATE_" + (String) cc.get("COL_NAME")
                                + "\"  data-options=\"onShowPanel:comboboxOnShowPanel, editable: false\"></input>");
                    } else if ("string".equals(cc.get("COL_TYPE"))) {
                        sb.append("<input class=\"easyui-validatebox\" title='" + (String) cc.get("COL_LABEL") + "' type=\"text\" name=\"INPU_" + (String) cc.get("COL_NAME") + "\" id=\"INPU_" + (String) cc.get("COL_NAME") + "\" ></input>");
                    } else if ("float".equals(cc.get("COL_TYPE"))) {
                        sb.append("<input class=\"easyui-numberbox\" title='" + (String) cc.get("COL_LABEL") + "' type=\"text\" name=\"INTE_" + (String) cc.get("COL_NAME") + "\" id=\"INTE_" + (String) cc.get("COL_NAME") + "\"  data-options=\"" + length + ",precision:"
                                + cc.get("COL_DECIMAL") + "\"></input>");
                    } else if ("clob".equals(cc.get("COL_TYPE"))) {
                        sb.append("<input class=\"easyui-validatebox\" title='" + (String) cc.get("COL_LABEL") + "' type=\"text\" name=\"CLOB_" + (String) cc.get("COL_NAME") + "\" id=\"CLOB_" + (String) cc.get("COL_NAME") + "\" ></input>");
                    }
                    sb.append("</td>");
                    sb.append("</sec:accesscontrollist>");
                }
                // 根据添加tr集合和补位td集合,补充html
                for (int j = 0; j < addTr.size(); j++) {
                    if (addTr.get(j) == i) {
                        for (int k = 0; k < addTd.get(j); k++) {
                            sb.append("<th></th><td></td>");
                        }
                        sb.append("</tr><tr>");
                    }
                }
            }
        }
        String r = "";
        if ((sb.length() - 4) == sb.lastIndexOf("<tr>")) {
            r = sb.substring(0, sb.length() - 4);
        } else {
            r = sb + "</tr>";
        }
        return r;
    }

    @Override
    public String getDatagridHtml(Map<String, Object> param) throws Exception {
        String datagridId = (String) param.get("datagridId");
        String datagridUrl = (String) param.get("datagridUrl");
        String datagridToolbarId = (String) param.get("datagridToolbarId");
        String datagridParam = (String) param.get("datagridParam");
        String domainObjectParam = (String) param.get("domainObjectParam");
        String operation = param.get("operation")==null?"":(String) param.get("operation");
        // 初始化字段格式化map
        Map<String, String> currentFormatter = null;
        if (param.containsKey("CURRENT_FORMATTER") && null != param.get("CURRENT_FORMATTER")) {
            currentFormatter = (Map<String, String>) param.get("CURRENT_FORMATTER");
        }
        List<Map<String, Object>> colList = (ArrayList<Map<String, Object>>) param.get("colList");
        List<Map<String, Object>> tabColList = (ArrayList<Map<String, Object>>) param.get("tabColList");

        StringBuffer sbHtml = new StringBuffer();
        sbHtml.append("");
        sbHtml.append("<table id=\"" + datagridId + "\"");
        sbHtml.append("    data-options=\"");
        sbHtml.append("		url:'" + datagridUrl + "',");
        sbHtml.append("		animate: false,");
        sbHtml.append("		collapsible: false,");
        sbHtml.append("		toolbar: '#toolbar',");
        sbHtml.append("		fitColumns: true,");
        sbHtml.append("		autoRowHeight: false,");
        sbHtml.append("		singleSelect: false,");
        sbHtml.append("		scrollbarSize:0,");
        sbHtml.append("		pagination:true,");
        /*if (null != colList&&colList.size()>0) {
            sbHtml.append("     rownumbers:true,");
        }*/
        // sbHtml.append("     rownumbers:true,");
        // sbHtml.append("		pageNumber:0,");
        sbHtml.append("		pageSize:100, ");
        //默认展示数据显示100条 xmw
//        sbHtml.append("		pageSize:20, ");
        sbHtml.append("		pageList:[20,30,50,100,500,1000], ");
        if (null != datagridToolbarId && !"".equals(datagridToolbarId)) {
            sbHtml.append("		toolbar:'#" + datagridToolbarId + "',");
        }
        sbHtml.append("		striped:true,");
        sbHtml.append("		fit:true,");
        //sanxaifiles create by zbj start
        //sbHtml.append("		fitColumns:true,");
        //sanxiafiles create by zbj end
        sbHtml.append("		selectOnCheck:true,");
        sbHtml.append("		checkOnSelect: true,");
        sbHtml.append("		method: 'post'");
        // datagrid自定义属性，事件
        if (null != datagridParam && !"".equals(datagridParam) && !"null".equals(datagridParam)) {
            sbHtml.append("," + datagridParam);
        }
        sbHtml.append("\">");

        sbHtml.append("		<thead>");
        sbHtml.append("			<tr>");
        sbHtml.append("				<sec:accesscontrollist  hasPermission=\"3\" domainObject =\"" + domainObjectParam + "_" + datagridId + "_id\">");
        /*if (null != colList&&colList.size()>0) {
            sbHtml.append("					<th data-options=\"field:'id', halign:'center',hidden:true\" title=\"主键ID\" >主键ID</th>");
        }else{*/
            sbHtml.append("					<th data-options=\"field:'id', halign:'center',checkbox:true\" title=\"主键ID\" >主键ID</th>");
        //}

        sbHtml.append("				</sec:accesscontrollist>");
        //sbHtml.append("					<th data-options=\"field:'number', halign:'center',formatter:formatOrder\" title=\"序号\">序号</th>");

        String attachmentClassName = commTableSysFieldLoader.getAttachmentClassName();// 资源文件中的类型名称
        List<String> attachmentClass = new ArrayList<String>();
        if (null != attachmentClassName && !"".equals(attachmentClassName)) {
            String[] attachArray = attachmentClassName.split(";");
            for (int i = 0; i < attachArray.length; i++) {
                attachmentClass.add(attachArray[i]);
            }
        }
        if (null != colList) {
            for (int i = 0; i < colList.size(); i++) {
                Map<String, Object> colObj = colList.get(i);
                String colNameCn = (String) colObj.get("COL_NAME_CN");
                int colNameCnIndex = colNameCn.length();
                int colWidth = 50;
                if (colNameCnIndex >= 3) {
                    colWidth = colNameCnIndex * 25;
                }
                // if ("全文".equals(colNameCn)) {
                // //colWidth = 100;
                // continue;
                // }
                sbHtml.append("		<sec:accesscontrollist  hasPermission=\"3\" domainObject =\"" + domainObjectParam + "_" + datagridId + "_" + colObj.get("COL_NAME_EN") + "\">");
                sbHtml.append("			<th data-options=\"field:'" + colObj.get("COL_NAME_EN") + "', halign:'center', align:'center', sortable:false,editor:{type:'text'}, fixed: true, width: " + colWidth + ", formatter: " + colObj.get("FORMATTER_NAME") + "\" title=\""
                        + colObj.get("COL_NAME_CN") + "\">" + colObj.get("COL_NAME_CN") + "</th>");
                sbHtml.append("		</sec:accesscontrollist>");
                if (i == 0 && "全文".equals(colObj.get("COL_NAME_CN"))) {
                    for (int j = 0; j < attachmentClass.size(); j++) {
                        String[] attachmentField = attachmentClass.get(j).split(",");
                        String formatName = "formatTooltip"; // 默认格式化
                        if ("DZ_COUNT".equals(attachmentField[0])) {
                            formatName = "formatDianZiForAttachRelation";
                        } else if ("PT_COUNT".equals(attachmentField[0])) {
                            formatName = "formatPuTongForAttachRelation";
                        } else if ("HT_COUNT".equals(attachmentField[0])) {
                            formatName = "formatHongTouForAttachRelation";
                        }
                        String regEx = "[\\u4e00-\\u9fa5]";
                        String term = attachmentField[1].replaceAll(regEx, "aa");
                        int idx = term.length();
                        int width = 50;
                        if (idx >= 6) {
                            width = idx * 13;
                        }
                        sbHtml.append("		<sec:accesscontrollist  hasPermission=\"3\" domainObject =\"" + domainObjectParam + "_" + datagridId + "_" + attachmentField[0] + "\">");
                        sbHtml.append("			<th data-options=\"field:'" + attachmentField[0] + "', halign:'center', align:'center', sortable:false,editor:{type:'text'}, fixed: true, width: " + width + ", formatter: " + formatName + "\" title=\"" + attachmentField[1] + "\">"
                                + attachmentField[1] + "</th>");
                        sbHtml.append("		</sec:accesscontrollist>");
                    }
                }
            }
        }

        boolean bool=false;

        if (null != tabColList) {
            for (int i = 0; i < tabColList.size(); i++) {
//                k++;
                Map<String, Object> colMap = tabColList.get(i);
                if ("FJ".equals(colMap.get("COL_TYPE"))){
                    bool=true;
                }
                if(i == 0){
                    if ("1".equals(operation)&&!bool){
                        sbHtml.append("				<sec:accesscontrollist  hasPermission=\"3\" domainObject =\"" + domainObjectParam + "_" + datagridId + "_id\">");
                        sbHtml.append("					<th data-options=\"field:'FJ', halign:'center',resizable:false,fixed:true, align:'center', sortable:false\" title=\"附件\" width=\"50\" >附件</th>");
                        sbHtml.append("				</sec:accesscontrollist>");
//                        continue;
                    }
                }

                sbHtml.append("					<sec:accesscontrollist hasPermission=\"3\" domainObject=\"" + domainObjectParam + "_" + datagridId + "_" + colMap.get("COL_NAME") + "\">");
                if ("string".equals(colMap.get("COL_TYPE"))) {
                    if ("ARCHIVE_POSITION".equals(colMap.get("COL_NAME"))) {
                        sbHtml.append("							<th data-options=\"field:'" + colMap.get("COL_NAME") + "', halign:'center', align:'center', formatter: formatArchivePosition, sortable:false,editor:{type:'text'}\" width=\"100\" title=\"" + colMap.get("COL_LABEL") + "\">"
                                + colMap.get("COL_LABEL") + "</th>");
                    } else {
                        // SanxiaFiles create by zhaoxiaolong 针对题名列改造宽度，其他列保持原来默认宽度为100
                        if ("TM".equals(colMap.get("COL_NAME"))) {
                            sbHtml.append("							<th data-options=\"field:'" + colMap.get("COL_NAME") + "', halign:'center', align:'left !important',sortable:false,editor:{type:'text'}");
                            if (null != colMap.get("FORMATTER") && !"".equals(colMap.get("FORMATTER")) && !"null".equals(colMap.get("FORMATTER"))) {
                                sbHtml.append(",formatter: " + colMap.get("FORMATTER") + "\" width=\"200\" ");
                            } else {
                                String formatter = "formatTooltip";
                                // 添加自定义格式化方法 判断字段是否存在自定格式化参数
                                if (null != currentFormatter && currentFormatter.containsKey(colMap.get("COL_NAME")) && null != currentFormatter.get(colMap.get("COL_NAME")) && !"".equals(currentFormatter.get(colMap.get("COL_NAME")))) {
                                    formatter = currentFormatter.get(colMap.get("COL_NAME"));
                                }
                                sbHtml.append(",formatter: " + formatter + "\" width=\"200\" ");
                            }
                            sbHtml.append(" title=\"" + colMap.get("COL_LABEL") + "\">" + colMap.get("COL_LABEL") + "</th>");
                        } else {
                            sbHtml.append("							<th data-options=\"field:'" + colMap.get("COL_NAME") + "', halign:'center', align:'center', sortable:false,editor:{type:'text'}");
                            if (null != colMap.get("FORMATTER") && !"".equals(colMap.get("FORMATTER")) && !"null".equals(colMap.get("FORMATTER"))) {
                                sbHtml.append(",formatter: " + colMap.get("FORMATTER") + "\" width=\"100\" ");
                            } else {
                                String formatter = "formatTooltip";
                                // 添加自定义格式化方法 判断字段是否存在自定格式化参数
                                if (null != currentFormatter && currentFormatter.containsKey(colMap.get("COL_NAME")) && null != currentFormatter.get(colMap.get("COL_NAME")) && !"".equals(currentFormatter.get(colMap.get("COL_NAME")))) {
                                    formatter = currentFormatter.get(colMap.get("COL_NAME"));
                                    sbHtml.append(",formatter: " + formatter);
                                }
                                if ("ARCHIVE_CODE".equals(colMap.get("COL_NAME"))){
                                    sbHtml.append("\"  width=\"200\" ");
                                }else {
                                    sbHtml.append("\"  width=\"100\" ");
                                }
                            }
//                        }
                        /*sbHtml.append("							<th data-options=\"field:'" + colMap.get("COL_NAME") + "', halign:'center', align:'center', sortable:false,editor:{type:'text'}");
                        if (null != colMap.get("FORMATTER") && !"".equals(colMap.get("FORMATTER")) && !"null".equals(colMap.get("FORMATTER"))) {
                            sbHtml.append(",formatter: " + colMap.get("FORMATTER") + "\" width=\"100\" ");
                        } else {
                            String formatter = "formatTooltip";
                            // 添加自定义格式化方法 判断字段是否存在自定格式化参数
                            if (null != currentFormatter && currentFormatter.containsKey(colMap.get("COL_NAME")) && null != currentFormatter.get(colMap.get("COL_NAME")) && !"".equals(currentFormatter.get(colMap.get("COL_NAME")))) {
                                formatter = currentFormatter.get(colMap.get("COL_NAME"));
                            }
                            sbHtml.append(",formatter: " + formatter + "\" width=\"100\" ");
                        }*/
                            /*xmw 添加是否关联组织*/
                            sbHtml.append("title=\"" + colMap.get("COL_LABEL") + "\">" + ("GCXMJDID".equals(colMap.get("COL_NAME")) ? "是否关联" : colMap.get("COL_LABEL")) + "</th>");
                        }
                    }
                } else if ("date".equals(colMap.get("COL_TYPE"))) {
                    sbHtml.append("							<th data-options=\"field:'" + colMap.get("COL_NAME") + "', halign:'center', align:'center', formatter: formatTooltipDate, sortable:false,editor:{type:'text'}\" width=\"80\" title=\"" + colMap.get("COL_LABEL") + "\">"
                            + colMap.get("COL_LABEL") + "</th>");
                } else {
                    sbHtml.append("							<th data-options=\"field:'" + colMap.get("COL_NAME") + "', halign:'center', align:'center', sortable:false,editor:{type:'text'}");
                    if (null != colMap.get("FORMATTER") && !"".equals(colMap.get("FORMATTER")) && !"null".equals(colMap.get("FORMATTER"))) {
                        sbHtml.append(", formatter: " + colMap.get("FORMATTER") + "\"");
                    } else {
                        sbHtml.append(", formatter: formatTooltip\"");
                    }
                    if ("ARCHIVE_CODE".equals(colMap.get("COL_NAME"))){
                        sbHtml.append(" width=\"200\" title=\"" + colMap.get("COL_LABEL") + "\">" + colMap.get("COL_LABEL") + "</th>");
                    }else if("ARCHIVE_IN_NUM".equals(colMap.get("COL_NAME"))){
                    	// 序号列变窄
                    	sbHtml.append(" width=\"30\" title=\"" + colMap.get("COL_LABEL") + "\">" + colMap.get("COL_LABEL") + "</th>");
                    }else {
                        sbHtml.append(" width=\"100\" title=\"" + colMap.get("COL_LABEL") + "\">" + colMap.get("COL_LABEL") + "</th>");
                    }
                }
                sbHtml.append("					</sec:accesscontrollist>");
            }
        }
        sbHtml.append("			</tr>");
        sbHtml.append("		</thead>");
        sbHtml.append("</table>");

        return sbHtml.toString();
    }

    /**
     * 通过配置文件获取附件相应字段
     *
     * @return
     * @throws Exception List<Map<String,Object>>
     * @throws
     */
    @Override
    public List<Map<String, Object>> getAttachmentClassMapByProperties() throws Exception {
        // 获取配置文件信息
        String attachmentClassName = commTableSysFieldLoader.getAttachmentClassName();
        List<Map<String, Object>> attachmentClass = new ArrayList<Map<String, Object>>();
        if (null != attachmentClassName && !"".equals(attachmentClassName)) {
            String[] attachArray = attachmentClassName.split(";");
            for (int i = 0; i < attachArray.length; i++) {
                String[] attachString = attachArray[i].split(",");
                Map<String, Object> attachMap = new HashMap<String, Object>();
                attachMap.put("COL_EN_NAME", attachString[0]);
                attachMap.put("COL_CN_NAME", attachString[1]);
                int idx = attachString[1].length();
                int width = 50;
                if (idx >= 3) {
                    width = idx * 25;
                }
                attachMap.put("WIDTH", width);
                attachmentClass.add(attachMap);
            }
        }
        return attachmentClass;
    }

    /**
     * 获取动态DETAIL页面HTML
     *
     * @param formShowList 动态字段数据集合
     * @param mapCode      通用代码字符串
     * @param param        {
     *                     MODEL_CODE: 模块CODE,
     *                     FORM_CODE: 表单CODE,
     *                     MODEL_COLUMN: 模板显示列数,
     *                     COL_SPAN: 对应字段跨列数组,
     *                     ROW_SPAN: 对应字段跨行数组
     *                     }
     * @return
     * @throws Exception
     */
    @Override
    public String getDynamicDetailHtmlByInput(List<Map<String, Object>> formShowList, Map<String, Map<String, String>> mapCode, Map<String, Object> param) throws Exception {
        // 定义模板列数样式
        Map<String, String> columnStyle = new HashMap<String, String>();
        // 模板列数
        int modelColumn = 3;
        // 跨列数组
        int[] colSpanIndex = null;
        // 跨行数组
        int[] rowSpanIndex = null;
        // 模块Code
        //String modelCode = "";
        // 表单Code
        //String formCode = "";
        if (null != param) {
            //modelCode = (String) param.get("MODEL_CODE");
            //formCode = (String) param.get("FORM_CODE");
            modelColumn = Integer.parseInt(param.get("MODEL_COLUMN") + "");
            // colspan list转数组
            List<Integer> colSpanList = (List<Integer>) param.get("COL_SPAN");
            if (colSpanList.size() > 0 && colSpanList.size() == formShowList.size()) {
                colSpanIndex = new int[colSpanList.size()];
                for (int i = 0; i < colSpanList.size(); i++) {
                    colSpanIndex[i] = colSpanList.get(i);
                }
            } else {
                colSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < colSpanIndex.length; i++) {
                    colSpanIndex[i] = 1;
                }
            }
            // rowspan list转数组
            List<Integer> rowSpanList = (List<Integer>) param.get("ROW_SPAN");
            if (rowSpanList.size() > 0 && rowSpanList.size() == formShowList.size()) {
                rowSpanIndex = new int[rowSpanList.size()];
                for (int i = 0; i < rowSpanList.size(); i++) {
                    rowSpanIndex[i] = rowSpanList.get(i);
                }
            } else {
                rowSpanIndex = new int[formShowList.size()];
                for (int i = 0; i < rowSpanIndex.length; i++) {
                    rowSpanIndex[i] = 1;
                }
            }
            if (colSpanList.size() != formShowList.size() || rowSpanList.size() != formShowList.size()) {
                SysLogUtil.log("构建动态详细页面方法", "构建动态详细页面方法出错，表单列值和实际列值不符！", OpType.select, OpResult.failure, LogBaseFactory.getLogBase());
            }
        }
        // 选择列宽样式
        switch (modelColumn) {
            case 1:
                columnStyle.put("thWidth", "35%");
                columnStyle.put("tdWidth", "65%");
                break;
            case 2:
                columnStyle.put("thWidth", "15%");
                columnStyle.put("tdWidth", "35%");
                break;
            case 3:
                columnStyle.put("thWidth", "10%");
                columnStyle.put("tdWidth", "23%");
                break;
            case 4:
                columnStyle.put("thWidth", "8%");
                columnStyle.put("tdWidth", "17%");
                break;
            default:
                columnStyle.put("thWidth", "20%");
                columnStyle.put("tdWidth", "80%");
                break;
        }
        // 计算数
        int sum = 0;
        // 添加tr下标
        List<Integer> addTr = new ArrayList<Integer>();
        // 补位td下标
        List<Integer> addTd = new ArrayList<Integer>();
        for (int i = 0; i < colSpanIndex.length; i++) {
            sum += colSpanIndex[i];
            // 如果计算数等于模板列数,则需进行换行,记录下标
            if (sum == modelColumn) {
                // 记录换行下标
                addTr.add(i);
                // 记录补位数
                addTd.add(0);
                // 清空计算数
                sum = 0;
            }
            // 判断索引是否可以循环下一次
            if (i < colSpanIndex.length - 1) {
                // 计算数累加下一下标跨列数
                int nextSum = sum + colSpanIndex[i + 1];
                // 如果累加下一跨列数大于模板列数,则记录换行下标,并记录补位数
                if (nextSum > modelColumn) {
                    // 记录换行下标
                    addTr.add(i);
                    // 记录补位数
                    addTd.add(modelColumn - sum);
                    // 清空计算数
                    sum = 0;
                }
            }
        }
        StringBuffer sb = new StringBuffer();
        sb.append("<tr>");
        for (int i = 0; i < modelColumn; i++) {
            sb.append("<th width='" + columnStyle.get("thWidth") + "'></th><td width='" + columnStyle.get("tdWidth") + "'></td>");
        }
        sb.append("</tr>");
        sb.append("<tr>");
        if (null != formShowList) {
            for (int i = 0; i < formShowList.size(); i++) {
                Map<String, Object> cc = formShowList.get(i);
                //String isMast = "";
                String labelbg = "";
                if ("Y".equals(cc.get("COL_IS_MUST"))) {
                    //isMast = "true";
                    labelbg = "";
                } else {
                    //isMast = "false";
                }
				/*String length = "";
				if (cc.get("COL_LENGTH") != null) {
					length = ",validType:'length[0," + cc.get("COL_LENGTH") + "]'";
				}*/
                // 参选
                if ("1".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                sb.append("");
                                sb.append("<th align='right' style='font-weight: normal;'><span class=\"" + labelbg + "\">");
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                while (iteratorCode.hasNext()) {
                                    String lookupCode = String.valueOf(iteratorCode.next());
                                    String lookupName = codeValue.get(lookupCode);
                                    if (cc.get("COL_VALUE").equals(lookupCode)) {
                                        if ("---请选择---".equals(lookupName)) {
                                            lookupName = "";
                                        }
                                        sb.append(lookupName);
                                    }
                                }
                                sb.append("</td>");
                            }
                        }
                    }
                } else if ("2".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    for (Map.Entry<String, Map<String, String>> me : mapCode.entrySet()) {
                        if (cc.get("COL_NAME").equals(me.getKey())) {
                            Map<String, String> codeValue = mapCode.get(cc.get("COL_NAME"));
                            if (codeValue != null) {
                                sb.append("<th align='right' style='font-weight: normal;'><span class=\"" + labelbg + "\">");
                                sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                                sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                                Iterator<String> iteratorCode = codeValue.keySet().iterator();
                                while (iteratorCode.hasNext()) {
                                    String lookupCode = String.valueOf(iteratorCode.next());
                                    String lookupName = codeValue.get(lookupCode);
                                    if (cc.get("COL_VALUE").equals(lookupCode)) {
                                        if ("---请选择---".equals(lookupName)) {
                                            lookupName = "";
                                        }
                                        sb.append(lookupName);
                                    }
                                }
                                sb.append("</td>");
                            }
                        }
                    }
                    // 如果为选择
                } else if ("3".equals(cc.get("COL_DROPDOWN_TYPE"))) {
                    if ("user".equals(cc.get("COL_RULE_NAME"))) {
                        // String ww = (String) cc.get("COL_NAME");
                        // 如果为生成规则英文字段为：user，那么该字段为选人页
                        // 字段不可编辑，在原ID基础上加1，不能创建选人页
                        sb.append("<th align='right' style='font-weight: normal;'><span class=\"" + labelbg + "\">");
                        sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                        sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                        sb.append((cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")));
                        sb.append("</td>");
                    } else if ("dept".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                        // 如果为生成规则英文字段为：dept，那么该字段为选部门页
                        // 字段不可编辑，在原ID基础上加1，不能创建选人页
                        sb.append("<th align='right' style='font-weight: normal;'><span class=\"" + labelbg + "\">");
                        sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                        sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                        sb.append((null == cc.get("COL_VALUE_NAME") || ("null".equals(cc.get("COL_VALUE_NAME"))) ? "" : cc.get("COL_VALUE_NAME")));
                        sb.append("</td>");
                    } else if ("custom".equals(cc.get("COL_RULE_NAME"))) {
                        // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                        // 如果为生成规则英文字段为：dept，那么该字段为自定义弹出页
                        // 字段不可编辑，去掉图片点击事件就不能创建弹出页
                        sb.append("<th align='right' style='font-weight: normal;'><span class=\"" + labelbg + "\">");
                        sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                        sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                        sb.append("<div style=\"position: relative; \">");
                        sb.append((cc.get("COL_VALUE_NAME").equals("null") ? "" : cc.get("COL_VALUE_NAME")));
                        sb.append("</div>");
                        sb.append("</td>");
                    }
                } else {
                    sb.append("<th align='right' style='font-weight: normal;'><span class=\"" + labelbg + "\">");
                    sb.append("</span>" + cc.get("COL_LABEL") + "：</th>");
                    sb.append("<td class=\"input-readonly\" colspan=\"" + (colSpanIndex[i] * 2 - 1) + "\">");
                    if ("integer".equals(cc.get("COL_TYPE"))) {
                        sb.append((null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")));
                    } else if ("float".equals(cc.get("COL_TYPE"))) {
                        sb.append((null == cc.get("COL_VALUE") || "null".equals(cc.get("COL_VALUE")) ? "" : cc.get("COL_VALUE")));
                    } else if ("date".equals(cc.get("COL_TYPE"))) {
                        sb.append((null == cc.get("COL_VALUE") || ("null".equals(cc.get("COL_VALUE"))) ? "" : cc.get("COL_VALUE")));
                    } else if ("string".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        sb.append(replaceValue);
                    } else if ("clob".equals(cc.get("COL_TYPE"))) {
                        String replaceValue = "";
                        if (null != cc.get("COL_VALUE") && !"null".equals(cc.get("COL_VALUE"))) {
                            replaceValue = (String) cc.get("COL_VALUE");
                            replaceValue = replaceValue.replaceAll("'", "&#39;");
                            replaceValue = replaceValue.replaceAll("\"", "&#34;");
                        }
                        sb.append(replaceValue);
                    }
                    sb.append("</td>");
                }
                // 根据添加tr集合和补位td集合,补充html
                for (int j = 0; j < addTr.size(); j++) {
                    if (addTr.get(j) == i) {
                        for (int k = 0; k < addTd.get(j); k++) {
                            sb.append("<th></th><td></td>");
                        }
                        sb.append("</tr><tr>");
                    }
                }
            }
        }
        String r = "";
        if ((sb.length() - 4) == sb.lastIndexOf("<tr>")) {
            r = sb.substring(0, sb.length() - 4);
        } else {
            r = sb + "</tr>";
        }
        return r;
    }
}
